<extend name="$home_public_template"/>

<block name="body">
    <!doctype html>
    <html lang="zh">
    <head>
    <meta charset="UTF-8">
    <title>阿迪</title>
    <link rel="stylesheet" type="text/css" href="css/normalize.css" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Home/css/classify/default.css">
    <link href='' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Home/css/classify/styles.css">


    </head>
    <body>
    	<div id="wrapper">
    <div class="cart-icon-top">
    </div>

    <div class="cart-icon-bottom">
    </div>

    <div id="checkout" style="margin-top:20px;color:gray;cursor:pointer;">
    	结算
    </div>

    <script>
        $('#checkout').click(function(){
            window.location.href = "{:U('Home/Cart/showcart')}";
        });

    </script>

    <div id="sidebar" style="margin-top:50px;">
        <h3>您选择的是:</h3>
        <span style="color:gray;">{$bread}</span>

    	<!-- <h3>购物车</h3>
        <div id="cart">
        	<span class="empty">购物车还是空空的哦</span>
        </div> -->
        
        <h3>掌柜推荐</h3>
        <foreach name="hot" item="vvv" >
            <div class="hotsale" onclick="skip(this)"> 
                <input type="hidden" value="{$vvv.0.goods_id}">
                <img src="./Uploads/{$vvv.hotsmallimg}"  alt="" width="150px" height="150px" class="imginfo">
                <div class="hotinfo">{$vvv.0.name}</div>
                <div class="hotinfo">价格 : &yen; {$vvv.0.price}</div>
                <div class="hotinfo">销量 :{$vvv.sale}</div>
            </div>
        </foreach>

        <script>
            function skip(obj){
                var id = $(obj).children().eq(0).val();
                var url = "{:U('Home/GoodsDetail/detail?id=idd')}";
                url = url.replace('idd', id);
                window.location.href = url;
            }
        </script>
    </div>



    
    <div id="grid-selector">
           <div id="grid-menu">
           	   View:
               <ul>             	   
                   <li class="largeGrid"><a href=""></a></li>
                   <li class="smallGrid"><a class="active" href=""></a></li>
               </ul>
           </div>
           
           <!-- Showing 1–9 of 48 results  -->
    </div>
    
    <div id="grid">
    <div>
        <div class="searchtime">

            <ul class="changeul">
                <a href="{:U('classify' , array('choose' => 'addtime' , 'id'=>$id ))}"><li style="line-height:20px;">上架时间</li></a>
                <a href="{:U('classify' , array('choose' => 'priceup' , 'id'=>$id))}"><li style="line-height:20px;">价格降序</li></a>
                <a href="{:U('classify' , array('choose' => 'pricedown' , 'id'=>$id))}"><li style="line-height:20px;">价格升序</li></a>
                <li class="sel" style="margin-left:320px;border:0px;">
                   
                </li>
                <li class="inp" style="border:0px;margin-left:90px;" >
                <form action="{:U('classify' , array('search' => 'search' , 'id'=>$id))}" method="post">
                    <input type="text" name="ipt" value="{$ss}" style="height:20px;width:145px;">
                    <input type="image" id="img" src="__PUBLIC__/Home/images/classify/2016-12-27_171017.png" style="display:block;width:24px;color:gray;position:absolute;top:0px;left:925px;">
                    <input type="hidden" value="{$ss}">
                </form>
                </li>
            </ul>
        </div> 
        <div style="clear:both;"></div>
    </div>

    <hr>
    <!-- 遍历开始 -->
    <foreach name="goods" key="key" item="vo" >
        <div class="product">
        	<div class="info-large">
            	<h4>FLUTED HEM DRESS</h4>
                <div class="sku">
                	PRODUCT SKU: <strong>98798798</strong>

                </div>
                 
                <div class="price-big">
                	<span>98798798</span> 
                </div>
                 
                <h3>COLORS</h3>
                <div class="colors-large">
                    <ul>
                        <li><a href="" style="background:#222"><span></span></a></li>
                        <li><a href="" style="background:#6e8cd5"><span></span></a></li>
                        <li><a href="" style="background:#f56060"><span></span></a></li>
                        <li><a href="" style="background:#44c28d"><span></span></a></li>
                    </ul> 
                </div>

                <h3>SIZE</h3>
                <div class="sizes-large">
     				<span>XS</span>
                    <span>S</span>
                    <span>M</span>
                    <span>L</span>
                    <span>XL</span>
                    <span>XXL</span>
                </div>
                
                <button class="add-cart-large">Add To Cart</button>                          
                             
            </div>

            <div class="make3D" index="1">
                <div class="product-front">
                    <div class="shadow"></div>
                    <img src="./Uploads{$vo['image_path']}" alt="" />

                    <div class="image_overlay"></div>
                    <!-- <div goodsid = "{$vo['goods_id']}" id="{$id}" class="add_to_cart addcart">加入购物车</div> -->
                    <input type="hidden" value="{$shopcount}">

                    <div class="view_gallery">查看大图</div>

                    <a href="url">
                        <a href="{:U('Home/GoodsDetail/detail' , array('id' => $vo['goods_id']))}" class="showdetail" style="text-decoration:none;color:white;" gid="{$vo['goods_id']}">
                        <div class="view_gallery" style="margin-top:65px;">
                            查看详情
                        </div>
                        </a>
                    </a>

                    <div class="detail_gallery"></div>                
                    <div class="stats">        	
                        <div class="stats-container" style="maring-top:200px;">
  
                            <span color="color" class="product_name" >{$vo['numcolor'] ? $vo['numcolor'] : 1}种颜色</span>
                            <span class="product_name" style="color:gray;">....................................</span>

                            <div name="name" style="margin-top:8px;color:gray;font-size:15px;">{$vo['name']}</div>

                            <div price = "price" class="product_name" style="margin-top:18px;">&yen;{$vo['price'][0]}</div>
                            <br> 
                            
                            <!-- 遍历小图片 -->
                            <empty name="vo['smallimg']">
                                <div style="width:60px;height:50px;background:red;" class="smallimages">
                                    <img src="./Uploads/{$imglist[$key][0][path]}{$imglist[$key][0][name]}"  alt="">
                                </div>
                            <else /> 
                                <foreach name="vo['smallimg']" key="ke" item="v" >
                                    <div style="width:60px;height:50px;margin-bottom:70px;" class="smallimages">
                                        <img src="./Uploads/{$v}"  alt="">
                                    </div> 
                                </foreach>
                            </empty> 
                            <!-- 遍历小图片结束 -->
                          
                        </div>                         
                    </div>
                </div>
                
                <div class="product-back">
                    <div class="shadow"></div>
                    <div class="carousel">
                        <ul class="carousel-container">

                            <!-- 遍历查看大图片 -->
                            <empty name="vo['smallimg']">
                            <foreach name="bigimg[$key]" key="bigke" item="bigv" >
                            <li>
                                
                                <img src="./Uploads{$bigv['path']}{$bigv['name']}" alt="" />
                                
                            </li>
                            </foreach>
                            <else />
                            <foreach name="bigimg[$key]" key="bigke" item="bigv" >
                            <li>
                                <img src="./Uploads{$bigv['path']}{$bigv['name']}" alt="" />
                            </li>
                            </foreach>
                            </empty> 
                            <!-- 遍历大图片结束 -->

                        </ul>
                        <div class="arrows-perspective">
                            <div class="carouselPrev">
                                <div class="y"></div>
                                <div class="x"></div>
                            </div>
                            <div class="carouselNext">
                                <div class="y"></div>
                                <div class="x"></div>
                            </div>
                        </div>
                    </div>
                    <div class="flip-back">
                        <div class="cy"></div>
                        <div class="cx"></div>
                    </div>
                </div>	  
            </div>
            
        </div>

        </foreach>
        <!-- 遍历结束 -->

        <empty name="goods">
            <div id="show" style="margin:30px auto;width:800px;height:50px;padding:10px;position:relative;float:left;line-height:50px;font-family:微软雅黑;font-size:16px;text-align:center;">没有搜索到此商品</div>
        <else />
            <div id="show" style="margin:30px auto;width:800px;height:50px;padding:10px;position:relative;float:left;line-height:50px;font-family:微软雅黑;font-size:16px;text-align:center;">{$show}</div>
        </empty> 
          



          <input type="hidden" id="decide" value="{$chek_session['decide']}">
          <input type="hidden" id="uid" id="decide" value="{$chek_session['user_id']}">
    </div>

       
       
    </div>

    </div>
    
</block>
<block name="script">
    <script src="__PUBLIC__/Home/js/classify/jquery-2.1.1.min.js" type="text/javascript"></script>
    <script src='__PUBLIC__/Home/js/classify/stopExecutionOnTimeout.js?t=1'></script>
    <script type="text/javascript" src="__PUBLIC__/Home/js/classify/main.js"></script>
    <script>
        
        $('.make3D').mouseover(function(){

            $(this).find('.smallimages').css('display' , 'block');
        }).mouseout(function(){
             $('.smallimages').css('display' , 'none');
        });

    </script>
    <script>
        $('.addcart').click(function(){

            var decide = $('#decide').val();
            if (decide == 1) {

                var user_id = $('#uid').val();
                var search = $(this).next().next().next().next().next();
                var goodsname = search.find("div[name]").html();

                var goodsid = $(this).attr('goodsid');
                var id = $(this).attr('id');
                console.log(goodsid);

                $.get("{:U('addcart')}", { goodsid: goodsid , id : id , user_id : user_id },function(data)
                {
                    // alert(data);

                    $('#shopcount').html(data);
                    
                });
                

            }else{
                window.location.href = "{:U('Home/User/login')}";
            }

                     
        });     


        // 添加访问量
        $('.showdetail').click(function(){
            var gid = $(this).attr('gid');
            $.get("{:U('action')}", { id : gid},function(data)
            {
                
            });           
        });

    </script>
</block>

<block name="footer">
   
</block>
